package com.tenement;

import com.tenement.netty.ChatServer;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

@SpringBootApplication
@Slf4j
@MapperScan("com.tenement.mapper")
@EnableWebMvc
@RequiredArgsConstructor
public class TenementApplication implements CommandLineRunner {



    private final ChatServer chatServer;

    public static void main(String[] args) {
        // 启动Spring应用
        SpringApplication.run(TenementApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        chatServer.chatServerStart(7135);
    }
}
